package com.suray.system.run.type;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.suray.basic.wcs.utils.IBaseEnum;

import java.io.Serializable;

public enum DeviceType implements IBaseEnum<Serializable> {

    RGV4(1,"4向车"),
    LIFTER_PLC(2,"plc提升机"),
    CONVERY(3,"输送线"),
    ;

    @EnumValue
    private int value;
    private String des;
    DeviceType(int value, String des) {
        this.value = value;
        this.des = des;
    }

    public static DeviceType parseDeviceType(int value) {
        for (DeviceType deviceType : DeviceType.values()) {
            if (deviceType.value == value) {
                return deviceType;
            }
        }

        throw new RuntimeException("未匹配到对应的设备：" + value);
    }

    @Override
    public String toString() {
        return des;
    }

    @Override
    public String getDescription() {
        return des;
    }

    @Override
    public Integer getVal() {
        return value;
    }

    @Override
    public Integer getValue() {
        return value;
    }
}
